const std = @import("std");

const Screenshotz = @import("screenshotz/Screenshotz.zig");


pub fn main() !void {
    const stdout_file = std.io.getStdOut().writer();
    var bw = std.io.bufferedWriter(stdout_file);
    const stdout = bw.writer();

    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    const allocator = gpa.allocator();

    var screenshotz = Screenshotz.init(allocator);
    defer screenshotz.deinit();

    const count = try screenshotz.NumActiveDisplays();
    // try stdout.print("count value: {d}\n", .{count});
    // try bw.flush();

    for (0..@intCast(count)) |i| {
        const bounds = try screenshotz.GetDisplayBounds(@intCast(i));
        _ = bounds;
        try stdout.print("iter: {d}\n", .{i});
    }
    try bw.flush();



    // _ = MessageBoxA(null, "world", "Hello", 0);

    // // Prints to stderr (it's a shortcut based on `std.io.getStdErr()`)
    // std.debug.print("All your {s} are belong to us.\n", .{"codebase"});
}

test "simple test" {
    var list = std.ArrayList(i32).init(std.testing.allocator);
    defer list.deinit(); // try commenting this out and see if zig detects the memory leak!
    try list.append(42);
    try std.testing.expectEqual(@as(i32, 42), list.pop());
}
